package com.cloud.common.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController extends BaseController {

    @GetMapping("/")
    public void index() throws Exception{
        String requestUrl = request.getRequestURL().toString();
        if (requestUrl.endsWith("/")) {
            requestUrl = requestUrl.substring(0, requestUrl.lastIndexOf("/"));
        }
        String redirectUrl = requestUrl + "/hystrix/monitor?stream=" + requestUrl + "/actuator/hystrix.stream";
        response.sendRedirect(redirectUrl);
        return;
    }

}
